package com.itheima.chapter09.io.objectstream;

import java.io.Serializable;

public class User implements Serializable {
    private String name;
    private transient String password;
    //transient 关键字所标记的成员变量不参与序列化过程
    private static final long  SerialversionUID =1l;
    //private static final long  SerialversionUID =1l;
    //不用计算机的虚拟机计算，我们手动给出Serialversion的值并且保持不变
    //当对象所属类Javabeen类修改时（修改变量权限），不出出现Serialversion数值不同的冲突
    public User() {
    }
    public User(String name, String password) {
        this.name = name;
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
